package com.blb.productservice.controller;

import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.blb.productservice.pojo.Product;
import org.springframework.http.ResponseEntity;

/**
 * 限流处理类
 */
public class ProductBlockHandler {

    public static String helloBlockHandler(BlockException ex){
        return "Hello被限流了";
    }

    public static ResponseEntity<Product> getProductByIdBlockHandler(Long id, BlockException ex){
        Product product = new Product();
        product.setName("被限流的数据");
        return ResponseEntity.ok(product);
    }
}
